import request from '@/utils/request'
// 地址列表
export const addressList = (data: any) => {
  return request({
    url: '/user-address/list',
    type: 'get',
    data
  })
}

//设置为默认地址
export const setDefaultAddress = (data: any) => {
  return request({
    url: '/user-address/setDefault',
    type: 'post',
    data
  })
}
//获取默认地址
export const defaultAddress = () => {
  return request({
    url: '/user-address/getDefault',
    type: 'get'
  })
}
//地址详情
export const addressInfo = () => {
  return request({
    url: '/user-address/details',
    type: 'get'
  })
}
//删除地址
export const deleteAddress = (data: any) => {
  return request({
    url: '/user-address/del',
    type: 'post',
    data
  })
}

//删除地址
export const saveAddrss = (data: any) => {
  return request({
    url: '/user-address/addOrUpd',
    type: 'post',
    data,
    qs: true
  })
}
